//
//  FYLoginNetworkingModule.m
//  FYNetworking
//
//  Created by Felix Yin on 2017/5/8.
//  Copyright © 2017年 Felix Yin. All rights reserved.
//

#import "FYLoginNetworkingModule.h"

@implementation FYLoginNetworkingModule

- (FYNetworkingRequestUnit *)login:(NSObject *)sender{
    return [FYNetworkingRequestUnit request:sender requestParam:@{@"uid":@"899",@"page":@"1"} APIPath:@"http://pengpeng2014.thefront.com.cn/myadmin/1.6.3/schedule_allWithEngagement.html" requestType:FYRequestTypePost resultProgressCallBack:^(NSProgress *taskProgress) {
        NSLog(@"taskProgress=== > %@",taskProgress);
    } operationCallBack:nil completeCallBack:^(id data, NSError *requestError) {
        if(requestError){
            NSLog(@"😞😞😞 ====>%@",requestError);
        }else{
            NSLog(@"data === > %@",data);
        }
    }];
}

- (FYNetworkingRequestUnit *)uploadAvatar:(NSObject *)sender{
    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"WechatIMG1.png" ofType:nil];
    return [FYNetworkingRequestUnit request:sender requestParam:nil APIPath:@"http://pengpeng2014.thefront.com.cn/myadmin/1.6.3/user_photo.html" uploadFileParameterName:@"avatar" fileName:@"user.png" filePath:filePath mineType:nil requestType:FYRequestTypeUpload resultProgressCallBack:^(NSProgress *taskProgress) {
        NSLog(@"%@",taskProgress);
    } uploadProgressCallBack:^(NSProgress *taskProgress) {
        NSLog(@"uploadProgressCallBack ======= >%@",taskProgress);
    } operationCallBack:nil completeCallBack:^(id data, NSError *requestError) {
        if(requestError){
            NSLog(@"requestError === > %@",requestError);
        }
    }];
}

- (void)dealloc{
   
    NSLog(@"FYLoginNetworkingModule");

}

@end
